<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateRecognizeBusinessLicenseResultsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('recognize_business_license_results', function (Blueprint $table) {
            $table->id();
            $table->string('url', 128)->unique('url')->comment('公开OSS库文件路径，全局唯一');
            $table->date('validPeriod')->nullable()->comment('有效期至');
            $table->string('address', 255)->default('')->comment('地址');
            $table->string('capital', 32)->default('')->comment('注册资本');
            $table->string('legalPerson', 32)->default('')->comment('法人');
            $table->date('establishDate')->nullable()->comment('有效期从');
            $table->string('name', 64)->default('')->comment('营业执照主体名');
            $table->string('registerNumber', 32)->default('')->comment('营业执照号码');
            $table->string('type', 32)->default('')->comment('营业主体类型');
            $table->string('business', 500)->default('')->comment('营业范围');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '图像识别 - 营业执照识别结果表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('recognize_business_license_results');
    }
}
